#pragma once
#include "loadUtils.h"
/**
 * @brief Struct for storing category data
 */
struct CategoryVars{
	int id;
	char desc[50];
};
/**
 * @brief Array of CategoryVars structs, allocated dynamically later on
 */
struct CategoryVars *catdata;

/**
 * @brief keeps count of how many categories we have, also used for memory reallocation
 */
int categorycount;

/**
 * @brief Load category file into memory
 *
 * @param filename
 *
 * @return return code
 */
int loadCategories(char const *filename);

/**
 * @brief save categorydata to file
 *
 * @param filename
 *
 * @return return code
 */
int writeCategories(char const *filename);

/**
 * @brief add a category to the vector, reallocates if needed
 *
 * @param n
 */
void addCategory(struct CategoryVars n);

/**
 * @brief removes a category by index, find it yourself first ;)
 *
 * @param index
 */
void rmClient(int index);

/**
 * @brief list the content of cat file
 *
 */
void listCategory();